import java.util.*;
//输入：
//["SchoolSystem", "addStudent", "addStudent", "addStudent", "addStudent"]
//[[1, 1, 0], [1], [2], [3], [1]]
//输出：
//[null, true, true, false, false]
public class SchoolSystem implements ISignUp{
    static int bigNum;
    static int mediumNum;
    static int smallNum;
    public void print(ArrayList<String> list){
        System.out.println(list);
    }
    //增加学生
    public boolean addStudent(int stuType){
        if(stuType==1){
            if(bigNum>0){
                bigNum--;
                return true;
            }
        }
        if(stuType==2){
            if(mediumNum>0){
                mediumNum--;
                return true;
            }
        }
        if (stuType==3){
            if (smallNum>0){
                smallNum--;
                return true;
            }
        }
            return false;
    }
    public SchoolSystem(Integer _big,Integer _medium,Integer _small){
        this.bigNum=_big;
        this.mediumNum=_medium;
        this.smallNum=_small;
    }
    public static void main(String[] args) throws Exception{
        IParams params=ISignUp.parse();  //SchoolSystem.parse();
        //构造方法
        SchoolSystem sc=new SchoolSystem(params.getBigNum(),params.getMediumNum(),params.getSmallNum());
        ArrayList<Integer> plan = params.getPlanSignUp();
        ArrayList<String> plan2=new ArrayList<String>();
        plan2.add("null");
        for(int i=0;i<plan.size();i++){
            plan2.add(String.valueOf(sc.addStudent(plan.get(i))));
        }
        sc.print(plan2);
    }
}
